Skip to content

[2.2.9] Improve build time - #3022

Open
Matteo-it wants to merge 19 commits into
mainfrom
Matteo-it/improve-build-time
Open

[2.2.9] Improve build time#3022
Matteo-it wants to merge 19 commits into
mainfrom
Matteo-it/improve-build-time

Conversation

@Matteo-it

Copy link
Copy Markdown
Contributor

Speed up deploy builds and stop stalled checkouts from hanging

@Matteo-it
Matteo-it force-pushed the Matteo-it/improve-build-time branch from c60d7e8 to 742e072 Compare August 31, 2026 06:31
@Matteo-it Matteo-it changed the title feat: try to improve build time [2.2.9] try to improve build time Aug 31, 2026
@Matteo-it
Matteo-it force-pushed the Matteo-it/improve-build-time branch from bfaa7b3 to c621fcf Compare September 1, 2026 09:16
@Matteo-it Matteo-it changed the title [2.2.9] try to improve build time [2.2.9] Improve build time Sep 3, 2026
@Matteo-it
Matteo-it force-pushed the Matteo-it/improve-build-time branch from ba25ccb to 2e2feda Compare September 3, 2026 08:22

@damianoc90 damianoc90 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the whole diff. The build work is well argued — the retry ladder wipes the workspace between attempts, every step is bounded and the jobs now have their own timeouts, and the tj-actions/changed-files pin is honest: I checked that 9426d409… really is the commit behind v47.0.6.

Three things I would fix before merge (first two inline below, plus the cache-save guard), and a few worth a look.

Not worth their own threads:

  • npm install -> npm ci. For a lockfile-driven deploy ci is the right verb and is usually faster with a warm npm cache; install can rewrite the lockfile in CI.
  • Action majors. They all exist, but several are one or two behind: checkout v5 (latest v7), setup-node v5 (v7), cache v5 (v6). upload-artifact@v7/download-artifact@v8 are current. If the lag is deliberate, fine — but this is the PR that touches all of them.
  • xargs … || echo "continuing" swallows a systemic failure too, not just the handful of .png files that are really JPEGs. If optipng fails to install, the build proceeds with uncompressed images and says so only in a log line.
  • The third checkout attempt has no timeout-minutes. Fine as it stands, since the new job timeout bounds it — worth a word in the comment so it reads as a choice.

Comment thread .github/workflows/deploy-staging.yml Outdated
Comment thread .github/workflows/preview.yml Outdated
Comment thread package.json
Comment thread .github/workflows/deploy-production.yml
Comment thread .github/workflows/stale-branch-cleanup.yml Outdated
Comment thread .github/workflows/deploy-production.yml
Comment thread content/hardware/02.uno/boards/uno-q/datasheet/it-datasheet.md
@Matteo-it

Copy link
Copy Markdown
Contributor Author

Thanks — the four items outside the threads, in order.

npm install -> npm ci. Deliberate, and I would keep install. ci installs the lockfile exactly, which freezes @arduino/docs-arduino-cc at the pinned version: today a theme release reaches the sites because install re-resolves it, and with ci every release would need a lockfile bump in each consumer repo first. npm ci is the better verb for a lockfile-driven deploy in general — it just conflicts with how this project ships the theme. The speed argument is also weaker than it looks here: with the warm npm cache and --prefer-offline --no-audit --fund=false the step went from 2.5 min to 0.6-0.8 min, which is the win we were after.

Action majors one or two behind. Deliberate for this PR. We learned the cost the hard way: bumping Node 18 -> 22 added node22 to the cache keys, which correctly invalidated every existing entry and cost one run 29 minutes of gatsby-plugin-sharp. Stacking three more major jumps into the same PR while we are measuring build time mixes the variables. Happy to do them as a follow-up, where a regression is attributable.

xargs … || echo swallowing a systemic failure. You are right, fixed. The install is now followed by command -v jpegoptim > /dev/null && command -v optipng > /dev/null, so a missing compressor stops the job while the per-file tolerance stays for the handful of .png files that are really JPEGs (three of them, all in content/hardware/09.kits/maker/iot-bundle, if anyone wants to fix them at the source).

Third checkout attempt without timeout-minutes. Reworded so it reads as a choice: "one more wipe and a last try, bounded by the job timeout".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants